/**
 * Created by Administrator on 2016/10/29.
 */
angular.module('restaurant.meal', [

    ])

    .config(['$stateProvider','$urlRouterProvider',
        function($stateProvider, $urlRouterProvider) {
            $stateProvider

                .state('model.meal.agency', {
                    url: '/agency',
                    templateUrl: service_templateprefix+ "restaurant/agency.html",
                    controller: 'AgencyController'
                })
                .state('model.meal.equipment', {
                    url: '/equipment',
                    templateUrl: service_templateprefix+"restaurant/equipment.html",
                    controller: 'EquipmentController'
                })
                .state('model.meal.four_pests', {
                    url: '/four_pests',
                    templateUrl: service_templateprefix+"restaurant/four_pests.html",
                    controller: 'Four_pestsController'
                })
                .state('model.meal', {
                    url: '/meal',
                    templateUrl: service_templateprefix+"restaurant/meal_service.html",
                    controller: 'MealController'
                })
                .state('model.meal.rush_pipe', {
                    url: '/rush_pipe',
                    templateUrl: service_templateprefix+"restaurant/rush_pipe.html",
                    controller: 'Rush_pipeController'
                })

        }])
     //证件代办
    .controller('AgencyController', ['$scope', '$state','ServiceRestaurant', function($scope,$state,ServiceRestaurant) {
        ServiceRestaurant.getServiceItem(2).$promise.then(function(data) {
            $scope.list = data
        });
    }])
     //设备修理
    .controller('EquipmentController', ['$scope', '$state','ServiceRestaurant', function($scope,$state,ServiceRestaurant) {
        ServiceRestaurant.getServiceItem(2).$promise.then(function(data) {
            $scope.list = data
        });

    }])
    //灭四�?
    .controller('Four_pestsController', ['$scope', '$state','ServiceRestaurant', function($scope,$state,ServiceRestaurant) {
        ServiceRestaurant.getServiceItem(2).$promise.then(function(data) {
            $scope.list = data
        });
    }])
     //餐政服务主页�?
    .controller('MealController', ['$scope', '$state','ServiceRestaurant', function($scope,$state,ServiceRestaurant) {
        $state.go("model.meal.equipment");

        //$scope.hidebot = function(){
        //    $(".model_bot").hide();
        //    $state.go('ucmodel.pay',{pId:$scope.buy_list.serviceitemid});
        //};

        $scope.show_hide = function(item){
            $scope.info = item;
            click_show1(".gdst_buy_fixed","#hidval")
        }

    }])
    //管道疏�??
    .controller('Rush_pipeController', ['$scope', '$state','ServiceRestaurant', function($scope,$state,ServiceRestaurant) {
        ServiceRestaurant.getServiceItem(2).$promise.then(function(data) {
            $scope.list = data

        });
    }])